package day04;
import java.util.Scanner;
public class CommandBySwitch {
    public static void main(String[] args) {
        //1. 接收用户输入的指令command(int),输出
        Scanner scan = new Scanner(System.in);
        System.out.println("请选择功能：1.存款 2. 取款 3. 查询余额 4. 退卡");
        int command = scan.nextInt();
        //System.out.println("您输入的命令是：" + command);
        switch (command){
            case 1:
                System.out.println("存款");
                break;
            case 2:
                System.out.println("取款");
                break;
            case 3:
                System.out.println("查询余额");
                break;
            case 4:
                System.out.println("退卡成功！");
                break;
            default:
                System.out.println("无效的命令！");
        }

        Scanner scan2 =new Scanner(System.in);
        System.out.println("此次交易的代号为：");
        int command2 = scan2.nextInt();
        switch (command2){
            case 1:
                System.out.println("交易成功！");
                break;
            case 2:
                System.out.println("交易失败！");
                break;
            default:
                System.out.println("无效的交易！");
        }
    }
}
